package com.songcha.library_common.ui.adapter

import android.content.Context
import android.view.View
import android.widget.TextView


import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder

import com.songcha.library_common.R



class DialogListAdapter(val mContext: Context, list:MutableList<String>) : BaseQuickAdapter<String,BaseViewHolder>(
    R.layout.common_item_dialog_list,list) {

    init {
       addChildClickViewIds(R.id.ll_dialog_list)
    }


    override fun convert(holder: BaseViewHolder, item:String) {

        holder.getView<TextView>(R.id.tv).text=item

        val line=holder.getView<View>(R.id.line1)

        if(holder.absoluteAdapterPosition==data.size-1){
            line.visibility=View.GONE
        }else{
            line.visibility=View.VISIBLE
        }


    }

}
